package demo10.composite.menuiterator;

import java.util.Iterator;
/**
 * 空迭代器
 * */
public class NullIterator implements Iterator<MenuComponent>{
	//什么也不要做
	@Override
	public MenuComponent next() {
		return null;
	}
  //永远返回false
	@Override
	public boolean hasNext() {
		return false;
	}
   
	/*
	 * java 8 已经不需要了
	 * 
	 * (non-Javadoc)
	 * @see java.util.Iterator#remove()
	 * */
	@Override
	public void remove() {
		throw new UnsupportedOperationException();
	}
	
}
